import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/plotting_base_entity.dart';

PlottingBaseEntity $PlottingBaseEntityFromJson(Map<String, dynamic> json) {
  final PlottingBaseEntity plottingBaseEntity = PlottingBaseEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    plottingBaseEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    plottingBaseEntity.companyId = companyId;
  }
  final String? dataId = jsonConvert.convert<String>(json['dataId']);
  if (dataId != null) {
    plottingBaseEntity.dataId = dataId;
  }
  final String? jsonDate = jsonConvert.convert<String>(json['json']);
  if (jsonDate != null) {
    plottingBaseEntity.jsonDate = jsonDate;
  }
  final int? createTime = jsonConvert.convert<int>(json['createTime']);
  if (createTime != null) {
    plottingBaseEntity.createTime = createTime;
  }
  return plottingBaseEntity;
}

Map<String, dynamic> $PlottingBaseEntityToJson(PlottingBaseEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['dataId'] = entity.dataId;
  data['json'] = entity.jsonDate;
  data['createTime'] = entity.createTime;
  return data;
}

extension PlottingBaseEntityExtension on PlottingBaseEntity {
  PlottingBaseEntity copyWith({
    int? id,
    int? companyId,
    String? dataId,
    String? jsonDate,
    int? createTime,
  }) {
    return PlottingBaseEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..dataId = dataId ?? this.dataId
      ..jsonDate = jsonDate ?? this.jsonDate
      ..createTime = createTime ?? this.createTime;
  }
}